<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    img{
        width: 200px;
    }
    canvas{
        border: 1px solid red;
    }
</style>
<body>
    <!-- <img src="./img/排骨.jpg"> -->
    <canvas width="500" height="500px">
      
    </canvas>
    <script>
        // 获取节点
        let canvas=document.querySelector("canvas")
        let ctx=canvas.getContext("2d")
    //    let img=document.querySelector("img")
    let img=new Image()
    img.src="./img/排骨.jpg"
       img.onload=function(){
        ctx.drawImage(img,0,0,200,113)
       }
       
    </script>
</body>
</html>